package com.pinyougou.manager.controller;

import com.pinyougou.pojo.TbItemCat;
import com.pinyougou.sellergoods.service.ItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/itemcat")
public class ItemController {
    @Autowired
    private ItemCatService itemCatService;
    @RequestMapping("/parent/{id}")
    public List<TbItemCat> finOneParent(@PathVariable(value = "id")Long id){
        List<TbItemCat> itemCats =  itemCatService.findOneParent(id);
        return itemCats;
    }
}
